<!-- /StudX_dir/StudX/student/templates/student/student_details_sanctions.html -->

{% load i18n %}

<div class="row justify-content-md-center">
	<div class="col-auto">
		<ul class="list-group">
			{% for item in student_discipline_stats %}
				<li class="list-group-item d-flex list-group-item-action justify-content-between align-items-center">
					{{item.type__sanction}}
					<span class="badge badge-primary badge-pill">{{item.num_sanction}}</span>
				</li>
			{% endfor %}
		</ul>
	</div>
</div>

<div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
   <div class="btn-group mt-2" role="group" aria-label="First group">
      <button type="button" class="btn btn-sm btn-outline-secondary float-left" disabled>Total: {{ student_disciplines|length }}</button>
   </div>
   <div class="btn-group float-right mt-2" role="group">
      <a class="btn btn-secondary btn-sm" href="#"><i class="fa fa-plus" aria-hidden="true"></i> {% trans "Add" %}</a>
      <a class="btn btn-sm btn-secondary" href="#"><i class="fa fa-flag" aria-hidden="true"></i> {% trans "Report" %}</a>
   </div>
</div>
{% if student_disciplines %}
<table class="table table-hover table-condensed mytable">
   <thead>
      <tr>
         <th>Sanctions</th>
         <th>{% trans "Creator" %}</th>
         <th>{% trans "Created at" %}</th>
         <th>Action</th>
      </tr>
   </thead>
   <tbody>
      {% for discipline in student_disciplines %}
		  <tr>
			 <td><a href="">{{ discipline.type.sanction }}</a></td>
			 <td>{{ discipline.creator.get_full_name }}</td>
			 <td>{{ discipline.created_at }}</td>
			 <td class="actions">
				<div class="btn-group btn-group-sm" role="group">
				   <a class="btn btn-outline-info btn-sm" href=""><i class="fas fa-eye"></i> </a>
				   {% if discipline.creator == user %}
				   <a class="btn btn-outline-info btn-sm" href=""><i class="fas fa-pencil-alt"></i> </a>
				   <a class="btn btn-outline-info btn-sm" href="#"><i class="fas fa-trash-alt"></i> </a>
				   {% endif %}
				</div>
			 </td>
		  </tr>
      {% endfor %}
   </tbody>
</table>
{% endif %}